/**
 * 
 */
package com.module.bp.event.base;

import com.module.bp.condition.Condition;

/**
 * The definition for all in-game events.
 * @author DaLoneDrau
 */
public interface Event {
	/**
	 * Fires the {@link Event}.
	 * @throws Exception if an error occurs
	 */
	void fire() throws Exception;
	/**
	 * Gets the {@link Condition} associated with this event.
	 * @return {@link Condition}
	 */
	Condition getCondition();
	/**
	 * Gets the {@link Event}'s id.
	 * @return <code>int</code>
	 */
	int getId();
	/**
	 * Determines if the {@link Event} happens. A {@link Event} with no
	 * {@link Condition} will always occur.
	 * @return <code>boolean</code>
	 */
	boolean happens();
	/**
	 * Determines if the {@link Event} has been resolved.
	 * @return true if the {@link Event} was resolved; false otherwise
	 */
	boolean isResolved();
	/** Resets the {@link Event}. */
	void reset();
	/**
	 * Sets the {@link Condition} tied to this {@link BaseEvent}.
	 * @param c the {@link Condition} to set
	 */
	void setCondition(Condition c);
	/**
	 * Sets the flag indicating that the {@link Event} has been fired.
	 * @param val the flag to set
	 */
	void setFired(final boolean val);
	/**
	 * Sets the flag indicating that the {@link Event} has been resolved.
	 * @param val the flag to set
	 */
	void setResolved(boolean val);
	/**
	 * Sets user input from a selection dialog.
	 * @param input the user input
	 */
	void setUserInput(int input);
	/**
	 * Sets user input from a yes/no dialog.
	 * @param input the user input
	 */
	void setUserInput(boolean input);
	/**
	 * Determines if an {@link Event} has been fired yet. {@link Event}s should
	 * only fire once. A fired {@link Event} doesn't have to be resolved.
	 * @return true if the {@link Event} was already fired; false otherwise
	 */
	boolean wasFired();
}
